package Levels;

import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.geom.AffineTransform;
import java.awt.image.ImageObserver;

import Game.Character;
import Game.Collision;
import Game.Dude;
import Game.Entity;
import Game.Explosion;
import Game.IndexCounter;
import Game.Mainth;
import Game.Movement;
import Game.Portal;
import Game.Sprite;
import Game.Wall;
import Guns.Cal45;
import Guns.Projectile;
import LifeForms.Chaser;
import LifeForms.PowerHunter;
import LifeForms.Robot;


public class Level1 extends Level{
	Objects stuff=new Objects();
	PowerHunter robot;
	PowerHunter robot2;
	
	public Level1() {
		robot=new PowerHunter(stuff.robotSprite,1,325,200);
		robot2=new PowerHunter(stuff.robotSprite,2,100,100);
		chars.add(robot);
		chars.add(robot2);
		robot2.setHardness(4);
		
	}
	void l_update(){
		robot.update(projectiles1);
		robot.control(projectiles1);
		robot2.update(projectiles1);
		for(int i=0;i<chars.size();i++){
			chars.get(i).death(chars,explosions,stuff.explosionSprite);
		}
		for(int i=0;i<explosions.size();i++){
			explosions.get(i).update(explosions);
			if(explosions.get(i).index.getIndex()>=9){
				explosions.remove(i);
				break;
			}
		}
		coll.giveCollision(projectiles1,chars,chasers, x, y);
		coll.giveCollision(projectiles2, chars, chasers, x, y);
		coll.objectCollision(chars,objects,xBound,yBound);
	}
	public void l_paint(Graphics g){
		Graphics2D g2d= (Graphics2D) g;
		for(Explosion e:explosions){
			e.Draw(g2d, nx, ny);
		}
		for(int i=0;i<chars.size();i++){
			chars.get(i).paint(g2d, x, y);
		}
	}
}
